﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 网络学习记录器
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        //ASP.NET打卡
        private void button1_Click(object sender, EventArgs e)
        {
            string flna = "ASP.NET";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c+1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 62 * 100, 2);
            label3.Text = c.ToString()+"%";
        }

        private void label3_Click(object sender, EventArgs e)
        {
        }
        //ASP.NET学习资源
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "https://www.bilibili.com/video/av56425945?p=1");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string flna = "ASP.NET";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = Math.Round(c / 62 * 100, 2);
            label3.Text = c.ToString() + "%";

            flna = "数据库原理";
            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 63 * 100, 2);
            label4.Text = c.ToString() + "%";

            flna = "概率论";
            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 63 * 100, 2);
            label13.Text = c.ToString() + "%";

            flna = "算法分析设计";
            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 7 * 100, 2);
            label15.Text = c.ToString() + "%";

            flna = "计算机网络";
            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 140 * 100, 2);
            label19.Text = c.ToString() + "%";

            flna = "英语四级";
            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 110 * 100, 2);
            label21.Text = c.ToString() + "%";

        }

        private void label4_Click(object sender, EventArgs e)
        {
        }
        //数据库原理打卡
        private void button2_Click(object sender, EventArgs e)
        {
            string flna = "数据库原理";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c + 1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 63 * 100, 2);
            label4.Text = c.ToString() + "%";
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "https://www.icourse163.org/learn/RUC-488001?tid=1206766202#/learn/content");
        }

        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "http://i.chaoxing.com/base?t=1581932688766");
        }

        private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {

        }

        private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(@"D:/学习资料/高斯课堂概率论");
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string flna = "概率论";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c + 1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 14 * 100, 2);
            label13.Text = c.ToString() + "%";
        }

        private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "https://www.icourse163.org/learn/HIT-356006?tid=1002851005#/learn/announce");
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string flna = "算法分析设计";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c + 1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 7 * 100, 2);
            label15.Text = c.ToString() + "%";
        }

        private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "https://www.icourse163.org/course/NJUPT-1001639008?tid=1207000253&from=study");
        }

        private void button6_Click(object sender, EventArgs e)
        {
            string flna = "计算机网络";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c + 1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 140 * 100, 2);
            label19.Text = c.ToString() + "%";
        }

        private void label23_Click(object sender, EventArgs e)
        {

        }

        private void linkLabel9_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("Chrome", "https://www.bilibili.com/video/av43421290?from=search&seid=6943171083792233901");
        }

        private void button7_Click(object sender, EventArgs e)
        {
            string flna = "英语四级";
            string a = TxtIO.TxtRead(flna);
            Double c = Double.Parse(a);
            c = c + 1;
            TxtIO.TxtWtite(flna, Convert.ToString(c));

            a = TxtIO.TxtRead(flna);
            c = Double.Parse(a);
            c = Math.Round(c / 110 * 100, 2);
            label21.Text = c.ToString() + "%";
        }
    
    }
}
